<div class="page">
	<div class="page-head">
		<h1 class="font-thin h4">客户代表管理</h1>
	</div>
	<div class="client-tab">
		<span ui-sref="app.client.client_editNew">基本信息</span>
		<span class="client-tab-cur" >客户代表</span>
		<span ui-sref="app.client.goodstype_manageNew">货物分类</span>
		<span ui-sref="app.client.goods_manageNew">货物</span>
		<span ui-sref="app.client.settleManagentNew">结算方</span>
		<span ui-sref="app.client.lineprice_manageNew">线路报价</span>
		<span ui-sref="app.client.projectManagentNew">工程</span>
		<span ui-sref="app.client.clientinfo_manageNew">客户资料</span>
		<span ui-sref="app.client.returnPeriodNew">对账回款周期</span>
	</div>
	<div class="page-body">
		 <!--form-horizontal-->
		<form name="step2" id="customerForm" class="form-validation" novalidate ng-controller="customerRepresentativeManagentControllerNew">
			<div class="list-body">
				<div class="client-company">						
					<label class="control-label pull-left client-companyLabel">客户单位：</label>
					<div class="col-md-2 form-group">
						<label class="control-label pull-left client-companyDetail">{{clientName}}</label>
					</div>
				</div>
				
				<div class="list-query">
					<div class="query-terms" ng-if="queryTermsFilterList[0].visible">
						<label class="control-label pull-left">姓名：</label>
						<input id="customerRepresentative_realName" type="text" class="form-control input-sm query-term" ng-model="queryTerms.name" name="realName" placeholder="请输入客户代表名称">
					</div>

					<div class="query-terms" ng-if="queryTermsFilterList[1].visible">
						<label class="control-label pull-left">职称：</label>
						<select id="customerRepresentative_job" class="form-control input-sm query-term tms-select" ng-model="queryTerms.job" name="job" ng-options="x.value as x.text for x in jobDropDown">
							<option value="">全部</option>
						</select>
					</div>

					<div class="query-terms">
						<label class="control-label pull-left"></label>
						<button id="customerRepresentative_query" ng-click="queryFunc()" class="btn tms-btn tms-btn-search" ng-class="{'disabled':querying}" ng-disabled="querying">
							<i class="fa fa-search" ng-show="!querying"></i>
							<i class="fa fa-spinner no-bordr" ng-show="querying" ng-class="{'fa-spin':querying}"></i>
							<span ng-show="!querying">查询</span>
							<span ng-show="querying">查询中...</span>
						</button>
					</div>
				</div>


				<div class="list-btn-area">
					<button id="customerRepresentative_add" class="btn tms-btn tms-btn-add" ng-click="addCustomerRepresentative()" data-toggle="modal" data-target="#customermyModal">添加</button>

					<div class="list-filter-container">
						<tms-list-filter 
							tab-head-filter="tabHeadFilter(item)"
							query-terms-filter-list="queryTermsFilterList"
							tab-head-filter-list="tabHeadFilterList"
						></tms-list-filter>
					</div>

				</div>

				<div class="list-table">
					<div  ui-grid="gridOptions" ui-grid-pagination ui-grid-auto-resize ui-grid-resize-columns style=" height:{{heightA}}px; overflow:hidden; min-width:1650px;">
						<div class="watermark" ng-if="!gridOptions.data.length">暂无数据</div>
					</div>
				</div>
			</div>

				<!-- Modal -->
				<div class="modal fade " id="customermyModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static">
				<div class="modal-dialog modal-lg">
						<div class="modal-content">
							<div class="modal-header client-modalHeader">
								<button id="customerRepresentative_miss" type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
								<h4 class="modal-title" id="myModalLabel">{{title}}</h4>
							</div>
							<div class="modal-body">
								<table class="table-bordered client-table">
									<tr>
										<td class="client-td-left"><span class="text-danger">*</span>姓名：</td>
										<td class="client-td-right linePrice-input">
											<input id="customerRepresentative_realNameBox" type="text" class="form-control input-sm ipt-3" name="realNameBox" ng-model="detail.name" required placeholder="请填写客户代表姓名">		
										</td>
									</tr>
									<tr>
										<td class="client-td-left"><span class="text-danger">*</span>职务：</td>
										<td class="client-td-right clientInfo-select">
											<select id="customerRepresentative_jobBox" class="form-control input-sm ipt-2 tms-select" name="jobBox" ng-model="detail.job" ng-options="x.value as x.text for x in jobDropDown" required>
												<option value="">请选择</option>
											</select>
										</td>
									</tr>
									<tr>
										<td class="client-td-left"><span class="text-danger">*</span>手机号码：</td>
										<td class="client-td-right linePrice-input">
											<input id="customerRepresentative_phoneNumber" type="tel" class="form-control input-sm ipt-3" name="phoneNumber" ng-model="detail.phoneNumber" placeholder="请填写手机号" ng-pattern="/^1\d{10}$/"
											required>
										</td>
									</tr>

									<tr>
										<td class="client-td-left">备注：</td>
										<td class="client-td-right">
											<textarea class="form-control project-textarea" ng-model="detail.remarks" placeholder="请再次填写备注" name="remarks"></textarea>
										</td>
									</tr>
								</table>
								
								<div class="clientIfo-bottom tms-editBtn">
									<button id="customerRepresentative_save" type="button" class="btn tms-btn tms-btn-save" ng-disabled="step2.$invalid" ng-click="detail.click()">保存</button>
									<button id="customerRepresentative_dismiss" type="button" class="btn tms-btn tms-btn-miss" data-dismiss="modal">取消</button>
								</div> 
							</div>

						</div>
					</div>
				</div>
		</form>
	</div>
	
</div>